package com.zpl.common.rpc;

/**
 * @author zhupanlin
 * @version 1.0
 * @description: TODO
 * @date 2024/9/8 11:49
 */
public class RpcAddress implements IServer{

    /**
     * 地址信息 IP
     */
    private String address;

    /**
     * 端口号
     */
    private int port;

    /**
     * 权重
     */
    private int weight;

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public int getPort() {
        return port;
    }

    public void setPort(int port) {
        this.port = port;
    }

    public int getWeight() {
        return weight;
    }

    public void setWeight(int weight) {
        this.weight = weight;
    }

    @Override
    public String toString() {
        return "RpcAddress{" +
                "address='" + address + '\'' +
                ", port=" + port +
                ", weight=" + weight +
                '}';
    }

    @Override
    public String url() {
        return this.address+":"+port;
    }

    @Override
    public int weight() {
        return this.weight;
    }
}
